package com.changgou.goods.dao;

import com.changgou.goods.pojo.Spec;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

public interface SpecMapper extends Mapper<Spec> {

    @Select("SELECT tb_s.name,tb_s.options from tb_spec tb_s JOIN (SELECT template_id FROM tb_category WHERE NAME=#{categoryName} GROUP BY template_id) " +
            "tb_c ON tb_s.template_id=tb_c.template_id order by tb_s.seq")
    public List<Map> findListByCategoryName(@Param("categoryName") String categoryName);
}
